﻿<?php include ("../connect.php"); ?>
<?php
if(isset($_POST['txtten_dn'])){
	$ten_dn=$_POST['txtten_dn'];
	//echo $ten_dn;exit;
	$mat_khau=$_POST['txtmk'];
	$email=$_POST['txtemail'];
	$dia_chi=$_POST['txtdia_chi'];
	$so_dt=$_POST['txtso_dt'];
	$quyen=$_POST['txtquyen'];
    $sql = "INSERT INTO thanh_vien(TEN_DN,MAT_KHAU,EMAIL,DIA_CHI,SO_DT,MS_QUYEN) 
	                    VALUES('$ten_dn','$mat_khau','$email',N'$dia_chi','$so_dt','$quyen')";
    
					
	$rs=mysql_query($sql);
	if($rs){
		echo "<script>
			alert('Đã thêm thành công...');
		 	location.href='../index.php?noidung=ttv';
			</script>";
		exit;
		}else {
		echo "<script>
			alert('Chưa thêm được...');
			location.href='../index.php?noidung=ttv';
			</script>";
		}
	}
?>